<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>咖啡不加糖 - 个人主页</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #818cf8;
            --primary-dark: #3730a3;
            --secondary: #ec4899;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --border-light: #e2e8f0;
            --radius: 12px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            --transition: all 0.3s ease;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 70px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 1.15rem;
            font-weight: 600;
            text-align: center;
            flex: 1;
        }
        
        .nav-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        
        .nav-btn:hover {
            background-color: var(--bg-light);
            color: var(--primary);
        }
        
        /* 封面图区域 */
        .cover-image {
            height: 180px;
            background: linear-gradient(135deg, #4f46e5, #818cf8);
            position: relative;
            overflow: hidden;
        }
        
        .cover-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            opacity: 0.8;
        }
        
        /* 个人资料区域 */
        .profile-container {
            padding: 0 16px;
            margin-top: -60px;
        }
        
        .avatar-container {
            display: flex;
            position: relative;
        }
        
        .profile-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            border: 4px solid var(--bg-white);
            overflow: hidden;
        }
        
        .profile-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .online-indicator {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background-color: #10b981;
            border: 2px solid white;
            position: absolute;
            bottom: 10px;
            left: 100px;
        }
        
        .profile-actions {
            margin-left: auto;
            display: flex;
            gap: 10px;
            align-items: flex-end;
            margin-bottom: 16px;
        }
        
        .profile-action-btn {
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 500;
            transition: var(--transition);
            border: none;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .message-btn {
            background-color: var(--primary);
            color: white;
        }
        
        .follow-btn {
            background-color: var(--bg-light);
            color: var(--text-primary);
            border: 1px solid var(--border-light);
        }
        
        .follow-btn.following {
            background-color: #fee2e2;
            color: #ef4444;
        }
        
        /* 个人信息 */
        .profile-info {
            padding: 16px;
            background-color: var(--bg-white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            margin-bottom: 12px;
        }
        
        .profile-name {
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 4px;
        }
        
        .profile-basics {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
        
        .profile-bio {
            font-size: 0.95rem;
            line-height: 1.6;
            margin-bottom: 16px;
        }
        
        .profile-stats {
            display: flex;
            justify-content: space-around;
            padding-top: 12px;
            border-top: 1px solid var(--border-light);
        }
        
        .stat-item {
            text-align: center;
        }
        
        .stat-value {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--text-primary);
        }
        
        .stat-label {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }
        
        /* 资料详情 */
        .profile-details {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            margin-bottom: 12px;
            overflow: hidden;
        }
        
        .detail-section {
            padding: 16px;
            border-bottom: 1px solid var(--border-light);
        }
        
        .detail-title {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .detail-content {
            font-size: 0.95rem;
        }
        
        .interest-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .interest-tag {
            padding: 4px 12px;
            background-color: rgba(79, 70, 229, 0.1);
            color: var(--primary);
            font-size: 0.85rem;
            border-radius: 16px;
        }
        
        /* 照片墙 */
        .photos-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 2px;
        }
        
        .photo-item {
            aspect-ratio: 1;
            overflow: hidden;
        }
        
        .photo-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: var(--transition);
        }
        
        .photo-item img:hover {
            transform: scale(1.05);
        }
        
        /* 留言区 */
        .messages-section {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            margin-bottom: 12px;
            padding: 16px;
        }
        
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }
        
        .section-title {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .view-all {
            font-size: 0.85rem;
            color: var(--primary);
        }
        
        /* 留言输入框 */
        .message-input-container {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }
        
        .message-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
        }
        
        .message-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .message-input-wrapper {
            flex: 1;
            position: relative;
        }
        
        .message-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-light);
            border-radius: 20px;
            font-size: 0.9rem;
            background-color: var(--bg-light);
            resize: none;
            height: 40px;
        }
        
        .message-input:focus {
            outline: none;
            border-color: var(--primary-light);
        }
        
        .send-btn {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
        }
        
        /* 留言列表 */
        .messages-list {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        
        .message-item {
            display: flex;
            gap: 10px;
        }
        
        .message-content {
            flex: 1;
        }
        
        .message-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 4px;
        }
        
        .message-author {
            font-size: 0.9rem;
            font-weight: 600;
        }
        
        .message-time {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }
        
        .message-text {
            font-size: 0.9rem;
            background-color: var(--bg-light);
            padding: 10px 12px;
            border-radius: 10px;
            border-top-left-radius: 4px;
            margin-bottom: 6px;
        }
        
        .message-actions {
            display: flex;
            gap: 16px;
            font-size: 0.8rem;
        }
        
        .message-action {
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 4px;
            cursor: pointer;
        }
        
        .message-action:hover {
            color: var(--primary);
        }
        
        .message-action.liked {
            color: #ef4444;
        }
        
        /* 回复区域 */
        .replies-container {
            margin-left: 50px;
            margin-top: 8px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        .reply-item {
            display: flex;
            gap: 8px;
        }
        
        .reply-content {
            flex: 1;
        }
        
        .reply-text {
            font-size: 0.85rem;
            background-color: var(--bg-light);
            padding: 8px 10px;
            border-radius: 8px;
            border-top-left-radius: 4px;
            margin-bottom: 4px;
        }
        
        .reply-author {
            font-weight: 600;
            margin-right: 6px;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 65px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            text-decoration: none;
        }
        
        .nav-item i {
            font-size: 1.25rem;
            margin-bottom: 4px;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        /* 提示消息 */
        .toast-message {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 0.9rem;
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast-message.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">个人主页</div>
        <button class="nav-btn" id="moreBtn">
            <i class="fas fa-ellipsis-v"></i>
        </button>
    </div>
    
    <!-- 封面图 -->
    <div class="cover-image">
        <img src="https://picsum.photos/id/416/800/400" alt="个人封面">
    </div>
    
    <!-- 个人资料容器 -->
    <div class="profile-container">
        <div class="avatar-container">
            <div class="profile-avatar">
                <img src="https://picsum.photos/id/91/200/200" alt="咖啡不加糖的头像">
            </div>
            <div class="online-indicator"></div>
            
            <div class="profile-actions">
                <button class="profile-action-btn message-btn">
                    <i class="fas fa-comment"></i>
                    <span>聊天</span>
                </button>
                <button class="profile-action-btn follow-btn" id="followBtn">
                    <i class="far fa-user-plus"></i>
                    <span>关注</span>
                </button>
            </div>
        </div>
        
        <!-- 个人信息 -->
        <div class="profile-info">
            <div class="profile-name">咖啡不加糖</div>
            
            <div class="profile-basics">
                <span>31岁</span>
                <span>·</span>
                <span>女</span>
                <span>·</span>
                <span><i class="fas fa-map-marker-alt"></i> 距离 5.8 公里</span>
            </div>
            
            <div class="profile-bio">
                咖啡师一枚，喜欢研究各种咖啡配方，偶尔烘焙面包。经营着一家小小的社区咖啡馆，周末会举办咖啡品鉴活动。寻找可以一起品尝咖啡、交流烘焙心得的朋友。
            </div>
            
            <div class="profile-stats">
                <div class="stat-item">
                    <div class="stat-value">128</div>
                    <div class="stat-label">关注</div>
                </div>
                <div class="stat-item">
                    <div class="stat-value">356</div>
                    <div class="stat-label">粉丝</div>
                </div>
                <div class="stat-item">
                    <div class="stat-value">78</div>
                    <div class="stat-label">动态</div>
                </div>
                <div class="stat-item">
                    <div class="stat-value">42</div>
                    <div class="stat-label">好友</div>
                </div>
            </div>
        </div>
        
        <!-- 兴趣爱好 -->
        <div class="profile-details">
            <div class="detail-section">
                <div class="detail-title">
                    <i class="fas fa-heart"></i>
                    <span>兴趣爱好</span>
                </div>
                <div class="detail-content">
                    <div class="interest-tags">
                        <span class="interest-tag">咖啡</span>
                        <span class="interest-tag">烘焙</span>
                        <span class="interest-tag">阅读</span>
                        <span class="interest-tag">摄影</span>
                        <span class="interest-tag">爵士音乐</span>
                        <span class="interest-tag">旅行</span>
                    </div>
                </div>
            </div>
            
            <div class="detail-section">
                <div class="detail-title">
                    <i class="fas fa-map-marker-alt"></i>
                    <span>所在地</span>
                </div>
                <div class="detail-content">
                    上海市静安区
                </div>
            </div>
            
            <div class="detail-section">
                <div class="detail-title">
                    <i class="fas fa-birthday-cake"></i>
                    <span>生日</span>
                </div>
                <div class="detail-content">
                    1994年3月15日
                </div>
            </div>
            
            <div class="detail-section">
                <div class="detail-title">
                    <i class="fas fa-calendar-alt"></i>
                    <span>加入时间</span>
                </div>
                <div class="detail-content">
                    2022年5月
                </div>
            </div>
        </div>
        
        <!-- 照片墙 -->
        <div class="profile-details">
            <div class="detail-section">
                <div class="detail-title">
                    <i class="fas fa-images"></i>
                    <span>照片 (12)</span>
                </div>
                <div class="photos-grid">
                    <div class="photo-item">
                        <img src="https://picsum.photos/id/431/300/300" alt="照片1">
                    </div>
                    <div class="photo-item">
                        <img src="https://picsum.photos/id/225/300/300" alt="照片2">
                    </div>
                    <div class="photo-item">
                        <img src="https://picsum.photos/id/425/300/300" alt="照片3">
                    </div>
                    <div class="photo-item">
                        <img src="https://picsum.photos/id/766/300/300" alt="照片4">
                    </div>
                    <div class="photo-item">
                        <img src="https://picsum.photos/id/292/300/300" alt="照片5">
                    </div>
                    <div class="photo-item">
                        <img src="https://picsum.photos/id/433/300/300" alt="照片6">
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 留言区 -->
        <div class="messages-section">
            <div class="section-header">
                <div class="section-title">留言板</div>
                <div class="view-all">查看全部</div>
            </div>
            
            <!-- 留言输入框 -->
            <div class="message-input-container">
                <div class="message-avatar">
                    <img src="https://picsum.photos/id/64/100/100" alt="我的头像">
                </div>
                <div class="message-input-wrapper">
                    <textarea class="message-input" placeholder="写下你的留言..." id="messageInput"></textarea>
                    <button class="send-btn" id="sendMessageBtn">
                        <i class="fas fa-paper-plane"></i>
                    </button>
                </div>
            </div>
            
            <!-- 留言列表 -->
            <div class="messages-list" id="messagesList">
                <!-- 留言1 -->
                <div class="message-item">
                    <div class="message-avatar">
                        <img src="https://picsum.photos/id/65/100/100" alt="用户头像">
                    </div>
                    <div class="message-content">
                        <div class="message-header">
                            <div class="message-author">夏日清风</div>
                            <div class="message-time">3天前</div>
                        </div>
                        <div class="message-text">
                            上周去了你的咖啡馆，手冲咖啡真的很棒！尤其是耶加雪菲，酸度刚刚好，很喜欢～
                        </div>
                        <div class="message-actions">
                            <div class="message-action like-action" data-id="1">
                                <i class="far fa-heart"></i>
                                <span>12</span>
                            </div>
                            <div class="message-action reply-action" data-id="1">
                                <i class="far fa-comment"></i>
                                <span>回复</span>
                            </div>
                        </div>
                        
                        <!-- 回复 -->
                        <div class="replies-container">
                            <div class="reply-item">
                                <div class="message-avatar">
                                    <img src="https://picsum.photos/id/91/100/100" alt="作者头像">
                                </div>
                                <div class="reply-content">
                                    <div class="reply-text">
                                        <span class="reply-author">咖啡不加糖</span>
                                        谢谢喜欢！耶加雪菲确实是我们店的招牌之一，每周都会更新不同产区的豆子，欢迎常来～
                                    </div>
                                    <div class="message-actions">
                                        <div class="message-action like-action" data-id="11">
                                            <i class="far fa-heart"></i>
                                            <span>3</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 留言2 -->
                <div class="message-item">
                    <div class="message-avatar">
                        <img src="https://picsum.photos/id/237/100/100" alt="用户头像">
                    </div>
                    <div class="message-content">
                        <div class="message-header">
                            <div class="message-author">音乐漫游者</div>
                            <div class="message-time">1周前</div>
                        </div>
                        <div class="message-text">
                            请问你用的是什么牌子的咖啡机？最近想在家自己做咖啡，正在研究设备
                        </div>
                        <div class="message-actions">
                            <div class="message-action like-action" data-id="2">
                                <i class="far fa-heart"></i>
                                <span>5</span>
                            </div>
                            <div class="message-action reply-action" data-id="2">
                                <i class="far fa-comment"></i>
                                <span>回复</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 留言3 -->
                <div class="message-item">
                    <div class="message-avatar">
                        <img src="https://picsum.photos/id/338/100/100" alt="用户头像">
                    </div>
                    <div class="message-content">
                        <div class="message-header">
                            <div class="message-author">篮球小子</div>
                            <div class="message-time">2周前</div>
                        </div>
                        <div class="message-text">
                            看到你分享的烘焙照片，那个蔓越莓面包看起来好美味！有机会能分享一下配方吗？
                        </div>
                        <div class="message-actions">
                            <div class="message-action like-action" data-id="3">
                                <i class="fas fa-heart liked"></i>
                                <span>24</span>
                            </div>
                            <div class="message-action reply-action" data-id="3">
                                <i class="far fa-comment"></i>
                                <span>回复</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-heart"></i>
            <span>交友</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-comment"></i>
            <span>消息</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息元素 -->
    <div class="toast-message" id="toastMessage"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById("backBtn");
        const moreBtn = document.getElementById("moreBtn");
        const followBtn = document.getElementById("followBtn");
        const messageInput = document.getElementById("messageInput");
        const sendMessageBtn = document.getElementById("sendMessageBtn");
        const messagesList = document.getElementById("messagesList");
        const toastMessage = document.getElementById("toastMessage");
        
        // 初始化
        function init() {
            setupEventListeners();
        }
        
        // 设置事件监听
        function setupEventListeners() {
            // 返回按钮
            backBtn.addEventListener("click", () => {
                history.back();
            });
            
            // 更多选项按钮
            moreBtn.addEventListener("click", () => {
                showToast("更多选项菜单");
            });
            
            // 关注/取消关注按钮
            followBtn.addEventListener("click", toggleFollow);
            
            // 发送留言按钮
            sendMessageBtn.addEventListener("click", sendMessage);
            
            // 按Enter发送留言
            messageInput.addEventListener("keypress", (e) => {
                if (e.key === "Enter" && !e.shiftKey) {
                    e.preventDefault();
                    sendMessage();
                }
            });
            
            // 自动调整输入框高度
            messageInput.addEventListener("input", adjustTextareaHeight);
            
            // 点赞功能
            document.addEventListener("click", (e) => {
                if (e.target.closest(".like-action")) {
                    const likeAction = e.target.closest(".like-action");
                    const icon = likeAction.querySelector("i");
                    const countElement = likeAction.querySelector("span");
                    let count = parseInt(countElement.textContent);
                    
                    // 切换点赞状态
                    if (icon.classList.contains("far")) {
                        icon.classList.remove("far");
                        icon.classList.add("fas", "liked");
                        countElement.textContent = count + 1;
                        showToast("点赞成功");
                    } else {
                        icon.classList.remove("fas", "liked");
                        icon.classList.add("far");
                        countElement.textContent = count - 1;
                        showToast("取消点赞");
                    }
                }
                
                // 回复功能
                if (e.target.closest(".reply-action")) {
                    const replyAction = e.target.closest(".reply-action");
                    const messageId = replyAction.getAttribute("data-id");
                    const author = replyAction.closest(".message-content").querySelector(".message-author").textContent;
                    
                    // 聚焦到输入框并添加回复前缀
                    messageInput.value = `@${author} `;
                    adjustTextareaHeight();
                    messageInput.focus();
                }
                
                // 照片点击
                if (e.target.closest(".photo-item img")) {
                    const imgSrc = e.target.getAttribute("src");
                    showToast("查看大图");
                }
                
                // 聊天按钮
                if (e.target.closest(".message-btn")) {
                    showToast("打开聊天窗口");
                }
            });
        }
        
        // 切换关注状态
        function toggleFollow() {
            const icon = followBtn.querySelector("i");
            const text = followBtn.querySelector("span");
            
            if (followBtn.classList.contains("following")) {
                // 取消关注
                followBtn.classList.remove("following");
                icon.classList.remove("fas", "fa-user-check");
                icon.classList.add("far", "fa-user-plus");
                text.textContent = "关注";
                showToast("已取消关注");
            } else {
                // 关注
                followBtn.classList.add("following");
                icon.classList.remove("far", "fa-user-plus");
                icon.classList.add("fas", "fa-user-check");
                text.textContent = "已关注";
                showToast("关注成功");
            }
        }
        
        // 发送留言
        function sendMessage() {
            const messageText = messageInput.value.trim();
            
            if (!messageText) {
                showToast("请输入留言内容");
                return;
            }
            
            // 创建新留言元素
            const newMessage = document.createElement("div");
            newMessage.className = "message-item";
            newMessage.innerHTML = `
                <div class="message-avatar">
                    <img src="https://picsum.photos/id/64/100/100" alt="我的头像">
                </div>
                <div class="message-content">
                    <div class="message-header">
                        <div class="message-author">我</div>
                        <div class="message-time">刚刚</div>
                    </div>
                    <div class="message-text">
                        ${messageText}
                    </div>
                    <div class="message-actions">
                        <div class="message-action like-action" data-id="new">
                            <i class="far fa-heart"></i>
                            <span>0</span>
                        </div>
                        <div class="message-action reply-action" data-id="new">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </div>
                    </div>
                </div>
            `;
            
            // 添加到留言列表顶部
            messagesList.insertBefore(newMessage, messagesList.firstChild);
            
            // 清空输入框
            messageInput.value = "";
            adjustTextareaHeight();
            
            // 显示成功提示
            showToast("留言成功");
            
            // 滚动到最新留言
            newMessage.scrollIntoView({ behavior: "smooth", block: "end" });
        }
        
        // 调整文本框高度
        function adjustTextareaHeight() {
            // 重置高度以正确计算滚动高度
            messageInput.style.height = "auto";
            
            // 设置新高度（最小40px，最大120px）
            const newHeight = Math.min(Math.max(messageInput.scrollHeight, 40), 120);
            messageInput.style.height = `${newHeight}px`;
        }
        
        // 显示提示消息
        function showToast(message) {
            // 设置消息内容
            toastMessage.textContent = message;
            
            // 显示消息
            toastMessage.classList.add("show");
            
            // 3秒后隐藏
            setTimeout(() => {
                toastMessage.classList.remove("show");
            }, 3000);
        }
        
        // 初始化页面
        document.addEventListener("DOMContentLoaded", init);
    </script>
</body>
</html>
